home *** CD-ROM | disk | FTP | other *** search
- Path: futon.SFSU.EDU!mclean
- From: mclean@futon.SFSU.EDU (Emmett Mclean)
- Newsgroups: comp.sources.wanted,comp.lang.c,comp.unix.programmer
- Subject: Seek unix2dos.c OR help with tr
- Date: 11 Mar 1996 04:10:46 GMT
- Organization: San Francisco State University
- Message-ID: <4i0946$7io@nuke.csu.net>
- NNTP-Posting-Host: futon.sfsu.edu
-
- Hi,
-
- Does anyone have the source to a program
- converting a unix file into dos format?
- That is, each decimal 10 char is replaced
- with a series of a 10 and 13.
-
- The equivalent syntax to tr would be fine
- as well.
-
- I will be using it to download zipped binaries
- files from a unix box.
-
- Ah, writing the program is a bit trickier
- than the little program below since the
- program exits prematurely because getchar reads
- EOF from its input - before getting to
- the real EOF.
-
-
- I archied unix2dos but the one ftp sites
- with unix2dos had an empty directory.
-
-
-
- #include <stdio.h>
- main(){
- char c;
- while(EOF!=(c=getchar())){
- if(10==c)putchar(13);
- putchar(c);
- }
- putchar(10);
- }
-
-
- Thanks,
-
- Emmett
-
-